package lyx.game.stage
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.utils.getQualifiedClassName;
	
	public class GameStage extends Sprite
	{
		public function GameStage()
		{
			initGameStageView();
			addEventListener(Event.ADDED_TO_STAGE,initGameStageAfterAddToStage);
			addEventListener(Event.REMOVED_FROM_STAGE,clearGameStageAfterRemoveFromStage);
		}
		
		private function initGameStageAfterAddToStage(event:Event):void
		{
			initGameStageEvent();
		}
		
		private function clearGameStageAfterRemoveFromStage(event:Event):void
		{
			destoryGameStageEvent();
		}
		
		protected function initGameStageView():void
		{
			throw new Error(getQualifiedClassName(this)+": initGameStageView() hasn't be override!");
		}
		
		protected function initGameStageEvent():void
		{
			throw new Error(getQualifiedClassName(this)+": initGameStageEvent() hasn't be override!");
		}
		
		protected function destoryGameStageEvent():void
		{
			throw new Error(getQualifiedClassName(this)+": destoryGameStageEvent() hasn't be override!");
		}
	}
}